# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=powershdll
pkgver=72.62cfa17
pkgrel=1
pkgdesc='Run PowerShell with rundll32. Bypass software restrictions.'
arch=('any')
groups=('blackarch' 'blackarch-windows')
url='https://github.com/p3nt4/PowerShdll'
license=('MIT')
depends=('git')
source=("$pkgname::git+https://github.com/p3nt4/PowerShdll.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 644 "$pkgdir/usr/share/windows/$pkgname"
  install -dm 644 "$pkgdir/usr/share/windows/$pkgname/exe"
  install -dm 644 "$pkgdir/usr/share/windows/$pkgname/dll"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  install -Dm 644 -t "$pkgdir/usr/share/windows/$pkgname/exe/" \
    exe/bin/Release/Powershdll.exe

  cp -a --no-preserve=ownership dll/bin/* \
    "$pkgdir/usr/share/windows/$pkgname/dll/"
}

